//
//  MineGiftViewController.m
//  Tongcheng
//
//  Created by 邢广范 on 2017/4/6.
//  Copyright © 2017年 Tongcheng. All rights reserved.
//我的-我的礼物

#import "MineGiftViewController.h"
#import "DLTabedSlideView.h"
#import "MineHavegiftViewController.h"
#import "MineNogiftViewController.h"

@interface MineGiftViewController ()<DLTabedSlideViewDelegate>

@property (weak, nonatomic) IBOutlet DLTabedSlideView *tabedSlideView;

@end

@implementation MineGiftViewController

- (void)setupNavigation
{
    self.navigationItem.title = @"我的礼物";
}

- (void)setupView
{
    self.tabedSlideView.baseViewController = self;
    self.tabedSlideView.flag = @"4";
    self.tabedSlideView.tabItemNormalColor = RGB(0xF95880);
    self.tabedSlideView.tabItemSelectedColor = RGB(0xF95880);
    
    self.tabedSlideView.delegate = self;
    self.tabedSlideView.tabNormalBackcolor = [UIColor whiteColor];
    self.tabedSlideView.tabSelectBackcolor = [UIColor whiteColor];
    
    self.tabedSlideView.tabbarTrackColor = RGB(0xF95880);
    self.tabedSlideView.tabbarBottomSpacing = 0.0;
    
    DLTabedbarItem *item1 = [DLTabedbarItem itemWithTitle:@"收到的礼物" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] normalColor:[UIColor blackColor] selectColor:[UIColor whiteColor]];
    DLTabedbarItem *item2 = [DLTabedbarItem itemWithTitle:@"送出的礼物" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] normalColor:[UIColor blackColor] selectColor:[UIColor whiteColor]];
    
    self.tabedSlideView.tabbarItems = @[item1, item2];
    [self.tabedSlideView buildTabbar];
    self.tabedSlideView.selectedIndex = 0;

}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupNavigation];
    [self setupView];
    // Do any additional setup after loading the view from its nib.
}

- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender{
    return 2;
}

- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index{
    switch (index) {
        case 0:
        {
            MineHavegiftViewController *ctrl = [[MineHavegiftViewController alloc] init];
            return ctrl;
        }
        case 1:
        {
            MineNogiftViewController *ctrl = [[MineNogiftViewController alloc] init];
            return ctrl;
        }
        default:
            return nil;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
